using System;
using UIFramework.Panel;
using UIFramework.Window;

namespace UIFramework.Core
{
    /// <summary>
    /// 所有UI界面必须实现的接口，统一风格
    /// </summary>
    public interface IScreenController
    {
        // 界面id
        string ScreenId { get; set;}
        // 是否显示
        bool IsVisible { get; }
        
        /// <summary>
        /// 显示
        /// </summary>
        /// <param name="props">携带参数</param>
        void Show (IScreenProperties props = null);
        
        /// <summary>
        /// 隐藏
        /// </summary>
        /// <param name="animate">是否需要动画</param>
        void Hide (bool animate = true);
        
        /// <summary>
        /// 进入动画完成时回调
        /// </summary>
        Action<IScreenController> InTransitionFinished { get; set; }
        /// <summary>
        /// 退出动画完成时回调
        /// </summary>
        Action<IScreenController> OutTransitionFinished { get; set; }
        /// <summary>
        /// 关闭时回调
        /// </summary>
        Action<IScreenController> CloseRequest { get; set; }
        /// <summary>
        /// 销毁时回调
        /// </summary>
        Action<IScreenController> ScreenDestroyed { get; set; }
    }

    /// <summary>
    /// 所有面板必须实现的接口
    /// </summary>
    public interface IPanelController :  IScreenController
    {
        PanelPriority Priority { get;}
    }

    /// <summary>
    /// 所有窗口必须实现的接口
    /// </summary>
    public interface IWindowController : IScreenController
    {
        bool HideOnForegroundLost { get; }
        bool IsPopup { get; }
        WindowPriority WindowPriority { get; }
    }
}